package com.meeting.model.enums;

/**
 * 用户状态枚举
 */
public enum UserStatusEnum {
    PENDING_REVIEW(0, "审核中"),
    ACTIVE(1, "正常"),
    FROZEN(2, "冻结"),
    REJECTED(3, "拒绝");

    private final int code;
    private final String description;

    UserStatusEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static UserStatusEnum fromCode(int code) {
        for (UserStatusEnum status : values()) {
            if (status.code == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("无效的用户状态码: " + code);
    }
}